import { defineStore } from "pinia";
import type { CardIconType } from "../types/youdaoDataTypes"
import { ref } from "vue";

export const useIconStore = defineStore("translate", () => {
    
    const cardIconState = ref<CardIconType[]>([
        {
            title: "背单词",
            icon: "icon-beidanci"
        },
        {
            title: "对话翻译",
            icon: "icon-gtranslate"
        },
        {
            title: "同传翻译",
            icon: "icon-xingzhuangjiehe-copy"
        },
        {
            title: "美剧刷词",
            icon: "icon-meiju"
        }
    ])
    const btnIconState = ref<CardIconType[]>([
        {
            title: "全球发音",
            icon: "icon-shangyehuaquanqiu"
        },
        {
            title: "听读训练",
            icon: "icon-weibiaoti-"
        },
        {
            title: "拍照解题",
            icon: "icon-jieticelve"
        },
        {
            title: "开挂背词",
            icon: "icon-dengpao"
        },
        {
            title: "词典笔",
            icon: "icon-edit"
        },
        {
            title: "大学备考",
            icon: "icon-danciben"
        },
        {
            title: "外刊精读",
            icon: "icon-a-ziyuan390"
        },
        {
            title: "快乐背词",
            icon: "icon-manyidutiaocha"
        },
        {
            title: "两句跟读",
            icon: "icon-rili"
        },
        {
            title: "全部功能",
            icon: "icon-quanbugongneng"
        }
    ])
    const homeActive = ref<number>(0)
    const reflectArr = ['home','study','xiaoq','wow','vip']
    const changeItem = (path:string) => {
        homeActive.value = reflectArr.indexOf(path)
    }
    return {
        cardIconState,
        btnIconState,
        homeActive,
        changeItem
    }
})